function getValueByKeychain (object, keychain) {
  const keys = keychain.split('.')

  let finallyValue = object
  for (let i = 0; i < keys.length; i++) {
    finallyValue = finallyValue[keys[i]]
  }
  return finallyValue
}

const obj = {
  a: {
    b: {
      c: 1
    }
  }
}

console.log(getValueByKeychain(obj, 'a.b.c'));